<?xml version="1.0" encoding="UTF-8"?>
<%@ page contentType="application/x-blueprint+xml;charset=UTF-8" language="java" %>

<page xmlns:xsd="http://mobile.yahoo.com/widgets/schema/1.5/blueprint/">
    <%
        String strlog = (String) session.getAttribute("login");
        String user = (String) session.getAttribute("user");
        if (strlog == null) {
    %>
    <models>
        <model id="login_info">
            <instance>
                <data xmlns="">
                    <u/>
                    <p/>
                </data>
            </instance>
            <submission method="urlencoded-post" resource="/login.jsp"/>
        </model>
    </models>
    <content>
        <module>
            <header layout="simple">
                <layout-items>
                    <block class="title">TuiTe for Mobile</block>
                </layout-items>
            </header>
            <input model="login_info" ref="u">
                <label>Twitter Account</label>
            </input>
            <secret model="login_info" ref="p">
                <label>Password</label>
            </secret>
            <submit model="login_info">
                <label>Login</label>
            </submit>
            <block>Usage: Login with your Twitter account info, than click update status button</block>
            <block>TuiTe for mobile is a service for Mobile device. You can use this to update your status,and more.</block>
            <block>Tese Version only include update status feature, and will grow.</block>
        </module>
    </content>
    <%
    } else {
    %>
    <models>
        <model id="update_info">
            <instance>
                <data xmlns="">
                    <status/>
                </data>
            </instance>
            <submission method="urlencoded-post" resource="/tui?ac=uptw"/>
        </model>
        <model id="shorten_url">
            <instance>
                <data xmlns="">
                    <surl/>
                    <sv>sto isgd cligs 307 toly</sv>
                </data>
            </instance>
            <submission method="urlencoded-post" resource="/tui?ac=su"/>
        </model>
    </models>
    <content>
        <module>
            <header layout="simple">
                <layout-items>
                    <block>TuiTe for you</block>
                </layout-items>
            </header>
            <block>Input your status in Tweet textfield, and click Update to Twitter</block>
            <input model="update_info" ref="status">
                <label>Tweet:</label>
            </input>
            <submit model="update_info">
                <label>Update</label>
            </submit>
            <block>If you need input a url, you could use shorten url for Tweet 140 limit.This use short.to, will add other service.</block>
            <input model="shorten_url" ref="surl">
                <label>URL(TO Short)</label>
            </input>
            <select1 appearance="popup" model="shorten_url" ref="sv">
                <label>ShortenURL Service</label>
                <item>
                    <label>Short.to</label>
                    <value>sto</value>
                </item>
                <item>
                    <label>is.gd</label>
                    <value>isgd</value>
                </item>
                <item>
                    <label>cli.gs</label>
                    <value>cligs</value>
                </item>
                <item>
                    <label>307.to</label>
                    <value>307</value>
                </item>
                <item>
                    <label>to.ly</label>
                    <value>toly</value>
                </item>
            </select1>
            <submit model="shorten_url">
                <label>To Short</label>
            </submit>
            <trigger>
                <label>logoff</label>
                <load event="activate" resource="/tui?ac=logout"/>
            </trigger>
        </module>
    </content>
    <%}%>
</page>